import random

# 打印出100以内的斐波那契数列，使用2种方法实现

a = 0
b = 1
while b < 100:
    print(b)
    a, b = b, a + b

lst = [1,1]
while lst[-1] + lst[-2] < 100:
    lst.append(lst[-1] + lst[-2])
print(lst)


# 使用python实现随机生成200无重复激活码，字符串长度大于5以上

characters1 = ''.join((chr(i) for i in range(97, 123)))
characters2 = ''.join(map(str, range(10)))
characters = characters1 + characters2
activecharacters = set()
while len(activecharacters) < 200:
    activecharacter = ''.join((random.choice(characters) for i in range(6)))
    activecharacters.add(activecharacter)
print(activecharacters)

# 方法2里斐波那契数列从0开始，其他的没问题。